Bluetooth Mesh Connectivity Challenges With Android

Launched in July 2017 officially, the Bluetooth mesh technology is an addition to the Internet of Things connectivity and networking space. Bluetooth has been a mainstay in short-range connectivity for tablets, consumer electronics, and smartphones. The Bluetooth Special Interest Group has always delivered tools and specifications that offer multi-vendor, global compatibility. 

The Bluetooth mesh profile features a full stack connectivity solution used for mesh networking that extends the application of Bluetooth for IoT uses. On Android devices, Bluetooth Mesh is used via existing Bluetooth Low Energy (BLE) capabilities. Bluetooth mesh networking standard works on BLE to allow many-to-many communications. 

 

What Is a Bluetooth Mesh Network?

Basically, a mesh network consists of a network of various devices or nodes that are connected dynamically, directly, or non-hierarchically to other nodes. The nodes work together through the exchange of data among them. 

BLE was introduced first in 2009 and was integrated into Bluetooth 4.0 in 2010. This technology was meant to offer smart connectivity solutions without using a lot of power. However, BLE at that time had limited power and only offered one-to-one communication. Simple devices across a network had to communicate through a central hub. 

In 2017, the Bluetooth mesh networking standard changed the game as the Mesh Profile integrated with Bluetooth 5 offered many-to-many communication. It is meant for networks that consist a lot of nodes or mesh devices broadcasting messages. This helps the IoT market through- 

  • More energy-efficient solutions 
  • More communication devices 
  • More safety and security
  • More flexible technologies 

 

How Do BLE Mesh Networks Work? 

The ability to broadcast messages is what separates the BLE mesh network from WiFi, Zigbee, and other technologies. Most wireless networks work through routing, but BLE mesh uses the managed flood principle. This technology provides the many-to-many communication model where every device or node can communicate with each other directly. 

Managed flooding does not require complex routing algorithms and makes messaging efficient. There is no need to use a central hub as messages can be sent to the right nodes easily. 

The scalability of BLE mesh connectivity is facilitated through multipath messaging and self-sufficient nodes. One can use any number of nodes to create any number of networks. A subscribe/publish model is used by BLE mesh network nodes to communicate with each other. 

Publishers can communicate with different device groups, while devices can subscribe to any address or a set of them so that they receive the messages they want to. This messaging capability allows you to configure a BLE mesh device and form networks serving different purposes. 

BLE mesh architecture follows a multi-layer structure- 

  • Upper layers are responsible for the message content 
  • Middle layers take care of the network’s logic and behavior 
  • Lower layers are responsible for message transmission 

Security is a big part of Bluetooth mesh connectivity, and the authentication and encryption systems for messages are based on the AES-CCM and AES-CMAC algorithms. Security keys are used to protect the messages and make sure communication among nodes is secure. To provision or add a device to the network, the new node gets a unique ID and security key access. 

 

Bluetooth Mesh Connectivity Challenges on Android 

As we discussed above, Bluetooth Mesh uses Bluetooth Low Energy capabilities to work on Android devices. You have to integrate the Android library https://github.com/NordicSemiconductor/Android-nRF-Mesh-Library into the project to meet Bluetooth mesh features’ requirements. 

At Sidekick Interactive we have decided on using this Mesh library from Nordic Semiconductor. This open-source project is available for both iOS and Android, which is an important factor for us when working on multi-platforms mesh projects.  

The library has proven to be very reliable but there were some integration and usage challenges that we faced through our projects. Here are some of them-  

Combining Required Bluetooth Components Together

The Mesh library allows the use of Bluetooth mesh features, but the BLE library is also important to perform BLE operations and form connections. The linking of both the BLE and Mesh library has proved difficult for some users. 

In order to connect to nearby Bluetooth devices, a Bluetooth scan process was necessary to perform to obtain the device address. To achieve this, core Bluetooth scan features provided by the Android platform have been used. 

Adding Missing Core Bluetooth Mesh Messages

There are several types of Bluetooth mesh messages that are not implemented by the Android Bluetooth Mesh library even though they are a part of Bluetooth mesh standards. In order to implement missing messages that are necessary to use, our developer has to do some additional work.

Adding Custom Bluetooth Mesh Messages

In some cases, a user may want to integrate extra Bluetooth mesh messages, also known as vendor messages. For this, the user has to provide parameters in order to specify their data type and the range of accepted values. 

For every message sent to a remote Bluetooth device, a response payload is sent back to the Android device, and it has to be provided with the same details. 

Keep the Mesh Network Model Up to Date

An Android app that communicates with one or more Bluetooth mesh devices must know about the devices that can be found within the mesh network. The Android Bluetooth mesh library is initialized in the app by loading the mesh network into it. 

The challenging part is that the Android application must have the fresh, latest version of the mesh network structure. When the mesh network is being manipulated by other entities or devices, then it becomes hard to achieve this aim. It is possible that another remote device may be adding, modifying, or even deleting Bluetooth mesh devices from the mesh network. 

Improving the Bluetooth Mesh Library Stability

The Android Bluetooth mesh library could require some customizations in the internal code of the library if some issues or crashes are encountered when communicating with remote Bluetooth mesh devices. This usually happens when the remote Bluetooth device does not comply with all the Bluetooth mesh definitions. 

 

Wrapping Up

A short-range, scalable IoT technology, Bluetooth mesh provides robust and efficient performance. The addition of Bluetooth Mesh profile to the existing ecosystem enhanced its capability to many new IoT use cases along with offering many-to-many communication. 

It can support the operation of thousands of devices across dense networks. With the use of Bluetooth Low Energy, it works on Android devices but there are many challenges associated with Bluetooth mesh connectivity on Android devices. 

With the right configuration of relevant parameters and proper deployment, these challenges can be tackled, and Bluetooth mesh can live up to its capability. If you are looking for a wireless system with scalable connectivity and safe data transfer, you should definitely use Bluetooth Mesh.